Skip to content

KAFKA-19712: Commit OFFSET_UNKOWN when closing state stores and the offsets are not yet initialized#21884

Open
eduwercamacaro wants to merge 1 commit intoapache:trunkfrom
eduwercamacaro:commit-sentinel-value-offsets-during-task-close
Open

KAFKA-19712: Commit OFFSET_UNKOWN when closing state stores and the offsets are not yet initialized#21884
eduwercamacaro wants to merge 1 commit intoapache:trunkfrom
eduwercamacaro:commit-sentinel-value-offsets-during-task-close

Conversation

@eduwercamacaro
Copy link
Copy Markdown
Contributor

@eduwercamacaro eduwercamacaro commented Mar 27, 2026

KAFKA-19712 got rid of sentinel values when uninitialized offsets were
committed. This made state stores close with invalid offsets when the
store's offsets were not yet initialized.

These changes rollback this decision because it was causing
TaskCorruptedException during rebalances.

Reviewers: Bill Bejeck bbejeck@gmail.com

@github-actions github-actions bot added triage PRs from the community streams small Small PRs labels Mar 27, 2026
Copy link
Copy Markdown
Member

@bbejeck bbejeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix @eduwercamacaro - LGTM with some minor comments

assertTrue(nonPersistentStore.committed);

// make sure that flush is called in the proper order
assertThat(persistentStore.getLastCommitCount(), Matchers.lessThan(nonPersistentStore.getLastCommitCount()));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: static import for Matchers


// the checkpoint file should contain an offset from the persistent store only.
final OffsetCheckpoint storeCheckpoint = new OffsetCheckpoint(storeCheckpointFile);
final Map<TopicPartition, Long> checkpointedOffsets = storeCheckpoint.read();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is validating the write path of null to OFFSET_UNKOWN do we want to re-open to confirm that OFFSET_UNKNOWN gets translated back to null?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

small Small PRs streams triage PRs from the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants